package com.edu.web;

import com.edu.Service.Impl.UserServiceImpl;
import com.edu.Service.UserService;
import com.edu.entity.Book;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/ShowBookServlet")
public class ShowBookServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        UserService userservice=new UserServiceImpl();
        List<Book> list= userservice.queryBook();
        request.setAttribute("list", list);
        request.getRequestDispatcher("ShowBook.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
